package com.ham.model;

import java.io.Serializable;

/**
 * 
 * @author dprima
 * 
 */
public class ItemModel implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7366382116548793361L;

	public static final String TABLE_NAME = "ITEM_TMP";

	private String id;
	private String name;
	private String purchaseDate;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPurchaseDate() {
		return purchaseDate;
	}

	public void setPurchaseDate(String purchaseDate) {
		this.purchaseDate = purchaseDate;
	}

	public String getInsertStatement() {
		StringBuffer sb = new StringBuffer("INSERT INTO ");
		sb.append(TABLE_NAME + " VALUES(");
		sb.append(getId());
		sb.append(",'" + getName() + "'");
		sb.append(",'" + getPurchaseDate() + "'");
		sb.append(")");
		return sb.toString();
	}

	@Override
	public String toString() {
		return "ItemModel [id=" + id + ", name=" + name + ", purchaseDate="
				+ purchaseDate + "]";
	}

}
